package pers.jason.wppm.security.core.validate.code.support;

import java.io.Serializable;

/**
 * 
 * @author Jason
 * @Date 2018-10-26 17:37
 *
 */
public class SimpleResponse implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private static final String RESULT_SUCCESS = "success";
	
	private static final String RESULT_FAILED = "failed";
	
	private String resultCode;

	private String content;
	
	private Object obj;

	public String getResultCode() {
		return resultCode;
	}

	public void setResultCode(String resultCode) {
		this.resultCode = resultCode;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Object getObj() {
		return obj;
	}

	public void setObj(Object obj) {
		this.obj = obj;
	}
	
	
	
	private SimpleResponse(String resultCode, String content, Object obj) {
		super();
		this.resultCode = resultCode;
		this.content = content;
		this.obj = obj;
	}

	public static SimpleResponse createSuccessResponse(String content) {
		return new SimpleResponse(RESULT_SUCCESS, content, null);
	}
	
	public static SimpleResponse createSuccessResponse(String content, Object obj) {
		return new SimpleResponse(RESULT_SUCCESS, content, obj);
	}
	
	public static SimpleResponse createFailedResponse(String content) {
		return new SimpleResponse(RESULT_FAILED, content, null);
	}
	
	public static SimpleResponse createFailedResponse(String content, Object obj) {
		return new SimpleResponse(RESULT_FAILED, content, obj);
	}
	
}
